package com.imooc.mall.exception;

/**
 * 异常枚举
 */
public enum ImoocMallExceptionEnum {

    NEED_USER_NAME(1001,"用户名不能为空"),
    NEED_PASSWORD(1002,"密码不能为空"),
    PASSWORD_TOO_SHORT(1003,"密码不能小于八位"),
    NAME_EXISTED(1004,"用户名重复，注册失败"),
    NAME_EXISTEDS(1004,"名重复，注册失败"),
    INSERT_FAILED(1005,"插入失败，请稍候再试"),
    PASSWORD_OR_NAME_FAILED(1006,"用户名或密码错误"),
    NEED_LOGION(1007,"请先登录后在操作"),
    UPDATE_FAILED(1008,"更新失败"),
    NEED_ADMIN(1009,"登录失败，需要管理员权限"),
    PARA_NOT_NULL(1010,"参数不能为空"),
    CREATE_FAILED(1010,"添加失败"),
    DELETE_FAILED(1011,"删除失败"),
    MKDIR_FAILED(1012,"文件创建失败"),
    SELECT_FAILED(1013,"查询失败"),
    NOT_SALE(1014,"商品状态异常"),
    NOT_ENOUGH(1015,"商品库存不足"),
    CART_EMPTY(1015,"购物车勾选商品为空"),
    NO_ENUM(1016,"枚举为空"),
    ORDER_MISS(1016,"订单号不存在"),
    NO_YOUR_ORDER(1016,"此订单号不属于你"),
    WRONG_ORDER_STATUS(1016,"此订单号暂不能修改"),
    NO_POWER(1016,"你没有权利修改此订单"),
    SYSTEM_ERROR(20001,"系统异常");

    /**
     * 异常码
     */
     Integer code;
    /**
     * 异常信息
     */
    String msg;

     ImoocMallExceptionEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
